package sjtu.rfid.rri.services.device;

import java.io.Serializable;

/**
 * Configuration of the reader
 * 
 * @author jinghao
 * 
 */
public class ReaderConfig implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8996614457605311474L;

	private String id;
	private String type;
	private boolean defaultStart;
	private String parameters;
	private String readingType;
	private ConnectionConfig connectionConfig;
	private QueueConfig InQueueConfig;
	private QueueConfig OutQueueConfig;

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the defaultStart
	 */
	public boolean isDefaultStart() {
		return defaultStart;
	}

	/**
	 * @param defaultStart
	 *            the defaultStart to set
	 */
	public void setDefaultStart(boolean defaultStart) {
		this.defaultStart = defaultStart;
	}

	/**
	 * @return the parameters
	 */
	public String getParameters() {
		return parameters;
	}

	/**
	 * @param parameters
	 *            the parameters to set
	 */
	public void setParameters(String parameters) {
		this.parameters = parameters;
	}

	/**
	 * @return the readingType
	 */
	public String getReadingType() {
		return readingType;
	}

	/**
	 * @param readingType
	 *            the readingType to set
	 */
	public void setReadingType(String readingType) {
		this.readingType = readingType;
	}

	/**
	 * @return the connectionConfig
	 */
	public ConnectionConfig getConnectionConfig() {
		return connectionConfig;
	}

	/**
	 * @param connectionConfig
	 *            the connectionConfig to set
	 */
	public void setConnectionConfig(ConnectionConfig connectionConfig) {
		this.connectionConfig = connectionConfig;
	}

	/**
	 * @return the inQueueConfig
	 */
	public QueueConfig getInQueueConfig() {
		return InQueueConfig;
	}

	/**
	 * @param inQueueConfig
	 *            the inQueueConfig to set
	 */
	public void setInQueueConfig(QueueConfig inQueueConfig) {
		InQueueConfig = inQueueConfig;
	}

	/**
	 * @return the outQueueConfig
	 */
	public QueueConfig getOutQueueConfig() {
		return OutQueueConfig;
	}

	/**
	 * @param outQueueConfig
	 *            the outQueueConfig to set
	 */
	public void setOutQueueConfig(QueueConfig outQueueConfig) {
		OutQueueConfig = outQueueConfig;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(type);
		sb.append(":");
		sb.append(id);
		sb.append(";readingType=");
		sb.append(readingType);
		if (null != parameters && parameters.length() != 0) {
			sb.append(";");
			sb.append(parameters);
		}
		return sb.toString();
	}

}
